<template>
  <div class="app-container">
  	<h4>基本信息</h4>
    <div class="change">
      
      <p>
        <span>退库处理人</span>
         <input v-model="tempData.managePerson" type="text" placeholder=""  />
        
      </p>

      <p>
        <span>退库时间</span>
        <el-date-picker v-model="tempData.receiveTime" type="date" value-format="yyyy-MM-dd" class="userselect" placeholder="选择日期"></el-date-picker>
      </p>
      
      
      <p>
        <span>业务所属公司</span>
        <input v-model="tempData.belongCompany" type="text" placeholder=""  />
        
      </p>
      
      <p>
        <span>退库后存放区域</span>
        <input v-model="tempData.belongEreas" type="text" placeholder=""  />
      </p>
      
      
     
      
      <p>
        <span>退库后存放地</span>
        <input v-model="tempData.belongPlace" type="text" placeholder="请输入存放地"  />
      </p>
      
      
      
      <p>
        <span>退库说明</span>
        <input v-model="tempData.receiveRemarks" type="text" placeholder="请输入备注"  />
      </p>
    </div>
    
    
    <h4>选择资产</h4>
    <div class="zd3-btm">
      
      <el-table :data="proData" :show-header="true" style="width: 100%;border-radius: 8px;">
        
        <el-table-column type="index" align="center" width="50" label="序号" fixed="left" />
        <el-table-column align="center" prop="invoices" width="100" label="资产SN编码" fixed="left" />
          <el-table-column align="center" prop="purchaseTime" width="150" label="资产名称" />
          <el-table-column align="center" prop="supplierId" width="150" label="资产类别" />
          <el-table-column align="center" prop="insertTime" width="150" label="当前所在公司" />
          <el-table-column align="center" prop="insertTime" width="150" label="当前所在部门" />
          <el-table-column align="center" prop="insertTime" width="150" label="当前使用人" />
          <el-table-column align="center" prop="insertTime" width="100" label="存放地点" />
        <el-table-column align="center" width="150" label="操作" fixed="right" v-if="!islook">
          <template slot-scope="scope">
            <el-button type="text" size="small" @click="save(scope.row,scope.$index)" v-if="scope.row.ischeck">保存</el-button>
            <el-button type="text" size="small" @click="write(scope.row,scope.$index)" v-else>修改</el-button>
            <el-popconfirm
              placement="top"
              hideIcon
              title="是否要删除此行？"
              @onConfirm="deleteRow(scope.row,scope.$index)"
            >
              <el-button type="text" size="small" slot="reference">删除</el-button>
            </el-popconfirm>
          </template>
        </el-table-column>
      </el-table>
    </div>

    <div class="submits" >
		
		<div class="nosave" @click="nosaveOrder">返回</div>
	</div>
    
    
  </div>
</template>
<script>
import { getUser,getBumen,getUserFiles } from '@/api/people'
import { getGongying,addCaigou,updateCaigouOrPro } from '@/api/caigou'
// import { getCangku,productOneClass,withIdGetPro } from '@/api/cangku'
import { inStock } from '@/api/cangku'
export default {
  data() {
    return {
      radio: "1",
			total: 1,
      value: '',
      tableData: [],
      proData:[],
      oneClassify: [],   //一级分类
      twoClassify: [],
      tempData: {
        receiveArea: "",//领用后存放区域
        receiveCompany: "", //领用后使用公司
        receiveRemarks : "",//领用说明
        receivePerson: "",//领用人
        receiveDepartment:"", //领用后使用部门
        receiveTime:"", // 领用时间
        recipientsNumber:"", //领用单号
        managePerson :"", //领用处理人
        
        
      },
			fileNum: [{
				filename: '',
				filePath: ''
			}],   //需要上传的文件个数
      ifydata: [{
        id: 0,
        departments: '全部',
        value: ''
			}],   //部门列表
      bumen: '',     //部门值
      buyerList: {},
      gongying: [], //供应商管理
      gys:'', //供应商选择值
			proDeail: [],  //商品列表
      peopleData: [],  //人员列表
      currentRow: null,
      gyShow: false, //供应商弹窗状态
      buyerShow: false, //采购员弹窗状态
			addProShow: false, //商品信息弹窗
      proData: [],
      writOradd: 0, //0新增，1编辑
			islook: false
    };
  },
  mounted(){
    this.getpeople()
    this.bumenList()
    this.gongyingList()
    console.log(this.$route.params)
   
    this.tempData = JSON.parse(this.$route.params.options)
     
  },
  methods: {
		
		
		
		
    goPrev(page) {
      console.log(page);
    },
    goNext(page) {
      console.log(page);
    },
    addzichan(){
    	this.addProShow = true
    	
    },
    noxuanzhong(){
    	this.addProShow = false
    },
    // 点击分类菜单获取对应商品
    
    xuanzhong(){
    	this.addProShow = false
    },
    
		// 取消新增
		nosaveOrder(){
			console.log('取消')
			this.$router.go(-1)
		}
  }
};
</script>
<style lang="scss" scoped>
.popup {
  padding: 0 20px;
}
.product{
  display: flex;
  .pro-l{
    width: 200px;
  }
  .pro-r{
    flex: 1;
    overflow: hidden;
    /deep/.el-table--enable-row-hover .el-table__body tr:hover>td {
      background-color: rgba(24,160,94,.2);
    }
    /deep/.el-table tr{
      cursor: pointer;
    }
    /deep/.el-table__body tr.current-row>td {
      background-color: rgba(24,160,94,.4);
    }
  }
}
.files {
  display: flex;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  margin-top: 20px;
  overflow: hidden;
  padding: 20px;
}
.files-btm .btn-prev:after {
  content: "上一页";
}
.files-btm .btn-next:before {
  content: "下一页";
}
.files-btm .btn-prev,
.files-btm .btn-next {
  width: 65px;
}
.files-left {
	width: 160px;
	margin-right: 20px;
	/deep/.el-menu{
		border-right: none;
	}
	/deep/.el-menu-item{
		height: 35px;
		line-height: 35px;
		margin-bottom: 8px;
	}
	/deep/.el-menu-item.is-active{
		color: #fff;
		border-radius: 5px;
		background: rgba(24,160,94,.8);
	}
}
.files-right {
  flex: 1;
  overflow: hidden;
}
.files-btm {
  background: rgba(255, 255, 255, 1);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  // margin-top: 20px;
  overflow: hidden;
  &-title {
    display: flex;
    align-items: center;
    height: 45px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
    > p {
      text-align: center;
      font-size: 16px;
      color: #333;
    }
  }
  .addDate {
    margin: 20px 32px 10px 32px;
    height: 32px;
    border-radius: 3px;
    text-align: center;
    line-height: 32px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    border: 1px dashed rgba(0, 0, 0, 0.3);
  }
  .el-button--text {
    margin: 0 15px;
  }
}
.avatar{
	width: 30px;
	height: 30px;
}
.zd3-btm {
  background: rgba(255, 255, 255, 1);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  margin-top: 10px;
  overflow: hidden;
  &-title {
    display: flex;
    align-items: center;
    height: 70px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
    > p {
      text-align: center;
      font-size: 16px;
      color: #333;
    }
  }
  .addDate {
    margin: 20px 32px 10px 32px;
    height: 32px;
    border-radius: 3px;
    text-align: center;
    line-height: 32px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    border: 1px dashed rgba(0, 0, 0, 0.3);
  }
  .el-button--text {
    margin: 0 15px;
  }
}
.inps {
  width: 95%;
  height: 32px;
  line-height: 32px;
  padding-left: 10px;
  background: none;
  border: none;
  color: rgba(0, 0, 0, 0.8);
}
.inps-active {
  width: 95%;
  height: 32px;
  line-height: 32px;
  padding-left: 10px;
  background: rgba(24,160,94,.2);
  border: none;
  color: rgba(0, 0, 0, 0.8);
}
h4{
	background: #fff;
	padding-top: 10px;
	padding-bottom: 10px;
	padding-left: 10px;
}
.change {
  display: flex;
  flex-wrap: wrap;
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-top: -5px;
  > p {
    width: 25%;
    font-size: 14px;
    display: flex;
    align-items: center;
    color: #333;
    /deep/.el-input__inner {
      // width: inherit;
      background: none;
      height: 32px;
      // line-height: 32px;
      color: #333;
      border: 1px solid rgba(0, 0, 0, 0.1);
      padding: 0 25px;
    }
    /deep/.el-input__icon {
      line-height: 32px;
    }
    .userselect {
      // max-width: 250px;
      flex: 1;
    }

    > span {
      display: block;
      width: 120px;
      text-align: right;
      padding-right: 15px;
    }
    > input {
      width: inherit;
      flex: 1;
      height: 32px;
      border-radius: 3px;
      border: 1px solid rgba(0, 0, 0, 0.1);
      padding-left: 10px;
      color: #333;
    }
  }
}
.submits{
	display: flex;
	padding: 15px 20px;
	justify-content: flex-end;
	align-items: center;
	>div{
		width: 80px;
		height: 32px;
		text-align: center;
		line-height: 32px;
		color: #fff;
		font-size: 14px;
		border-radius: 4px;
		margin-left: 30px;
		cursor: pointer;
	}
	.save{
		background: #2196F3;
	}
	.nosave{
		background: #999;
	}
}

.avatar-uploader .el-upload {
	  border: 1px dashed #999 !important;
	  border-radius: 6px;
	  cursor: pointer;
	  position: relative;
	  overflow: hidden;
	  width: 100%;
	}
	.avatar-uploader .el-upload:hover {
	  border-color: #409eff;
	}
	
	.avatar-uploader-icon {
	  font-size: 28px;
	  color: #8c939d;
	  width: 100px;
	  height: 100px;
	  line-height: 100px;
	  text-align: center;
		border: 1px solid #ccc
	}
	.avatar {
	  width: 100px;
	  height: 100px;
	  display: block;
	}




.fileup{
  padding: 20px 0;
  display: flex;
  flex-wrap: wrap;
	background: #fff;
	border-radius: 0 0 8px 8px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	// justify-content: space-between;
  // align-items: center;
  flex-direction: column;
  // justify-content: center;
  > p {
    width: 50%;
    font-size: 14px;
    display: flex;
		flex-wrap: wrap;
    align-items: center;
    color: #333;
    /deep/.el-input__inner {
      // width: inherit;
      background: none;
      height: 32px;
      // line-height: 32px;
      color: #333;
      border: 1px solid rgba(0, 0, 0, 0.1);
      padding: 0 25px;
    }
    /deep/.el-input__icon {
      line-height: 32px;
    }
    /deep/.el-upload-dragger {
			width: 100%;
      height: 100px;
    }
    /deep/.el-upload-dragger .el-icon-upload {
      font-size: 60px;
      color: #C0C4CC;
      margin: 0; 
      line-height: 1;
			width: 100%;
    }
		/deep/.el-upload {
			width: 100%;
		}

    .userselect {
      // max-width: 250px;
      flex: 1;
    }

    > span {
      display: inline-block;
      width: 100px;
      text-align: right;
      padding-right: 15px;
			&:last-child{
				text-align: left;
			}
    }
    > input {
      width: inherit;
      flex: 1;
      height: 32px;
      border-radius: 3px;
      border: 1px solid rgba(0, 0, 0, 0.1);
      padding-left: 10px;
      color: #333;
    }
		>strong{
			display: inline-block;
			padding-right: 100px;
			font-weight: 100;
			font-size: 14px;
			&:last-child{
				cursor: pointer;
				color: #13ce66;
				font-weight: 600;
			}
		}
    >div{
      width: inherit;
      flex: 1;
    }
  }
}
@media screen and (max-width: 1400px) {
  .change > p {
    width: 33%;
  }
}
</style>